<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" id="txt" />
		<p id="text_show"></p>
		<script>
			var obj = {}
			Object.defineProperty(obj, 'txt', {
				get: function(){
					return obj
				},
				set: function(newValue){
					// document.getElementById('txt').value = newValue;
					document.getElementById('text_show').innerHTML = newValue;
				}
			})
			document.addEventListener("keyup",function(e){
				obj.txt = e.target.value
			})
		</script>
	</body>
</html>
